
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>支付配置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/style/admin.css" media="all">
<body layadmin-themealias="default" style="">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item" style="height: 20px;line-height: 20px;">
                <div class="layui-inline" style="margin-right: 0px;">
                     <span class="layui-breadcrumb">
                        <a href="">首页/支付配置</a>
                        </span>
                </div>
                <div class="layui-inline" style="right: 0px;position: absolute;">
                    <a class="layui-btn layui-btn-small" style="line-height:20px;margin-top:-6px;float:right" href="javascript:location.replace(location.href);" title="刷新">
                        &nbsp;<i class="layui-icon layui-icon-refresh-3" style="line-height:18px;left: 12px;top:12px;"></i>&nbsp;
                    </a>
                </div>
            </div>
        </div>
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="width: 800px;">
            <div class="layui-form-item">
                <label class="layui-form-label">签名秘钥</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" placeholder=" 请输入签名秘钥" value="{$data['mdkey']}" lay-verify="required" name="mdkey" >
                </div>
            </div>
  <!--          <div class="layui-form-item">
                <label class="layui-form-label">平台商务号</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" placeholder=" 请输入平台商务号" value="{$data['merchantcode']}" lay-verify="required" name="merchantcode"  >
                </div>
            </div>-->

            <div class="layui-form-item">
                <label class="layui-form-label">商户ID</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" placeholder=" 请输入集团编号" value="{$data['mgroupcode']}" lay-verify="required" name="mgroupcode"  >
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">支付接口</label>
                <div class="layui-input-block" style="margin-right: 0px;">
                    <input type="text" class="layui-input" placeholder=" 请输入支付接口地址" value="{$data['payapi']}" lay-verify="required" name="payapi"  >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">银行编号</label>
                <div class="layui-input-block" style="margin-right: 0px;">
                    <input type="text" class="layui-input" placeholder=" 请输入支付类型" value="{$data['payapi']}" lay-verify="required" name="paytype"  >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">后台地址</label>
                <div class="layui-input-block" style="margin-right: 0px;">
                    <input type="text" class="layui-input" placeholder=" 请输入管理后台地址" value="{$data['weburl']}" lay-verify="required" name="weburl"  >
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block" style="margin-right: 0px;">
                    <input type="text" class="layui-input" placeholder=" 请输入管理用户名" value="{$data['username']}" lay-verify="required" name="username"  >
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-block" style="margin-right: 0px;">
                    <input type="text" class="layui-input" placeholder=" 请输入管理密码" value="{$data['password']}" lay-verify="required" name="password"  >
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="text-align: center">
                   <button class="layui-btn" lay-submit lay-filter="formsub">更新配置</button>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>
<script>

    layui.config({
        base: '__PUBLIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set'], function(){
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table;

        form.on('submit(formsub)',function (data) {
            $.ajax({
                type:'post',
                dataType:"json",
                url:'payment',
                data:data.field,
                success:function (data) {
                    if(data['code'] == 1){
                        layer.msg(data['msg'], {icon: 1,end:function () {
                               window.location.reload()
                            }});
                    }else{
                        layer.msg(data['msg'], {icon: 2,end:function () {
                                window.location.reload()
                            }});
                    }
                },
                error:function () {
                    layer.msg('发生错误', {icon: 2});
                },
            });
        });
    });
</script>
</body>
</html>
